package com.kjc.demo.basic.listener;

import java.util.Map;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author: 刘强
 * @Date: 2019-08-29 9:42
 * @Version 1.0
 * @Description: 实时交易的消费者
 */
@Slf4j
@Component
public class PaymentPriorityOrderCallListener {

    @RabbitListener(queues = "kjc.queue")
    public void processPaymentOrderMessage(Message message) {
        byte[] input = message.getBody();
        Map paymentOrderDTO = JSONObject.parseObject(input, Map.class);
        // 请求支付前的校验是否通过
        if (paymentOrderDTO == null) {
            log.warn("【实时订单-消费者】支付请求订单消息:null");
            return;
        }
        log.info("【实时订单-消费者】支付订单消息：{}", JSONObject.toJSONString(paymentOrderDTO));

       
    }
}
